package com.tianhui.consignortwofei.widget;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.EditText;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.fgs.common.CommonDialog;
import com.fgs.common.widget.itemView.SettingItemView;
import com.tianhui.consignortwofei.R;


/**
 * @author fgs
 * @date 2020/4/9
 * @description
 **/
public class QueRenWaiDialog extends CommonDialog {
    private TextView positiveTextView;
    private TextView negativeTextView;
    private SettingItemView siv_daohuo_time;

    private EditText tipTextView;
    private EditText contentTextView;
    private String content;
    private TextView tv_title;

    public QueRenWaiDialog(@NonNull Context context, String content) {
        super(context, R.style.style_select_dialog);
        this.content = content;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_queren_wai);
        setCancelable(true);
        setCanceledOnTouchOutside(false);
        positiveTextView = findViewById(R.id.layout_operate_tip_dialog_positiveTextView);
        negativeTextView = findViewById(R.id.layout_operate_tip_dialog_negativeTextView);
        siv_daohuo_time = findViewById(R.id.siv_daohuo_time);

        tv_title = findViewById(R.id.layout_operate_tip_dialog_titleTextView);

        tipTextView = findViewById(R.id.dialog_order_share_tipTextView);
        contentTextView = findViewById(R.id.dialog_order_share_contextTextView);

//        String tip = "请将以下内容通过聊天工具发送给司机，司机登录APP后即可查看此订单";
//        tipTextView.setText(tip);


        tv_title.setText(content);

//        positiveTextView.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                dismiss();
//                copyOrderInfoToInputManager(content);
//            }
//        });


        negativeTextView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
            }
        });
    }

//    private void copyOrderInfoToInputManager(String content) {
//        //获取剪贴板管理器：
//        // 得到剪贴板管理器
//        ClipboardManager cm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
//        // 创建一个剪贴数据集，包含一个普通文本数据条目（需要复制的数据）
//        ClipData clipData = ClipData.newPlainText("Label", content);
//        // 把数据集设置（复制）到剪贴板
//        LogUtil.print(content);
//        cm.setPrimaryClip(clipData);
//    }
//
//    public String getShareContent() {
//        return contentTextView.getText().toString();
//    }

    public String getDriverName() {
        return tipTextView.getText().toString();
    }
    public String getChePaiName() {
        return contentTextView.getText().toString();
    }
    public TextView getTrue() {
        return positiveTextView;
    }

    public void setEmpty() {
        tipTextView.setText("");
        contentTextView.setText("");
    }

    public SettingItemView getTime() {
        return siv_daohuo_time;
    }




}
